//
//  YTDeviceController.m
//  YUNT
//
//  Created by haha on 2017/11/12.
//  Copyright © 2017年 梁炜东. All rights reserved.
//

#import "YTDeviceController.h"
#import "YTHomePreviewVC.h"
#import "YTBleContentView.h"
#import "YTDeviceContentView.h"

@interface YTDeviceController ()<YTDeviceContentViewDeleage>
@property (weak, nonatomic) IBOutlet UIButton *connectButton;

@end

@implementation YTDeviceController

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    [self.navigationController.navigationBar setHidden:YES];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    
    YTDeviceContentView *deviceContentView = [[YTDeviceContentView alloc] init];
    deviceContentView.delegate = self;
    [self.view addSubview:deviceContentView];
}
#pragma mark YTDeviceContentViewDeleage
-(void)delegateDeviceContentViewbType:(YTDeviceContentViewButtonType)btnType
{
    if (btnType == YTDeviceContentViewButtonConnect)
    {
        YTBleContentView *bleView = [[YTBleContentView alloc] initWithBlock:^{
            YTHomePreviewVC *homeVC = [[YTHomePreviewVC alloc] init];
            [self.navigationController pushViewController:homeVC animated:YES];
        }];
        [self.view addSubview:bleView];
    }
}
@end
